package edu.sctu.zhuyingzhi.month201506.day20150628.theSecondTestV2.Util;

import edu.sctu.zhuyingzhi.month201506.day20150628.theSecondTestV2.Data.MainData;
import edu.sctu.zhuyingzhi.month201506.day20150628.theSecondTestV2.Data.PostMap;
import edu.sctu.zhuyingzhi.month201506.day20150628.theSecondTestV2.Data.UrlConfig;

import java.io.IOException;

/**
 * Created by user13 on 2015/6/28.
 */
public class MyThread implements Runnable {

    @Override
    public void run() {
        try {
            System.out.println("程序于 5秒后开始");
            for (int i = 5; i > 0; i--) {
                System.out.println(i);
                Thread.sleep(1000);
            }

            WebUtil.usePostRequests(UrlConfig.URL_HOME, PostMap.getmap("1", "50"));
            JsonUtil jsonUtil = new JsonUtil();
            MainData jsonClass = jsonUtil.jsonToClass("D:/Json/Json.txt");

            jsonUtil.SerializableJson(jsonClass, "D:/Json/Appbean.txt");
            GoodsUtil.judgeGoods(jsonUtil.antiSerializableJson("D:/Json/Appbean.txt"));

        } catch (InterruptedException e) {
            e.printStackTrace();
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
